<template>
    <div>
        <el-form ref="form" :model="form" label-width="130px">
            <div class="source">
                <h3>合规来源信息</h3>
                <div class="form-box">
                    <div class="box1">
                        <el-form-item label="条款编号：">
                            <el-input v-model="basicForm.cardCode_" size="mini" disabled></el-input>
                        </el-form-item>
                        <el-form-item label="条款名称：">
                            <el-input v-model="basicForm.termName_" size="mini" disabled></el-input>
                        </el-form-item>
                        <el-form-item label="条款号：">
                            <el-input v-model="basicForm.termCode_" size="mini" disabled></el-input>
                        </el-form-item>
                    </div>
                    <div :class="{ box4: basicForm.sourceType_ != '3', box1: basicForm.sourceType_ == '3' }">
                        <el-form-item label="条款适用产品：">
                            <el-select
                                v-model="basicForm.suitableFund_"
                                placeholder="请选择"
                                size="mini"
                                disabled
                                v-if="basicForm.sourceType_ == '3'"
                            >
                                <el-option></el-option>
                            </el-select>
                            <el-row v-else>
                                <el-col :span="8">
                                    <el-checkbox v-model="basicForm.publicMoneyTerm_" disabled>公募</el-checkbox>
                                    <span>产品类型</span>
                                    <el-select v-model="basicForm.fundTypePublicTerm_" placeholder="请选择" size="mini" disabled>
                                        <el-option></el-option>
                                    </el-select>
                                </el-col>
                                <el-col :span="8">
                                    <el-checkbox v-model="basicForm.simuTerm_" disabled>私募</el-checkbox>
                                    <span>产品类型</span>
                                    <el-select v-model="basicForm.fundTypeSimuTerm_" placeholder="请选择" size="mini" disabled>
                                        <el-option></el-option>
                                    </el-select>
                                </el-col>
                                <el-col :span="8">
                                    <el-checkbox v-model="basicForm.zhuanhuTerm_" disabled>专户</el-checkbox>
                                    <span>产品类型</span>
                                    <el-select v-model="basicForm.fundTypeZhuanhuTerm_" placeholder="请选择" size="mini" disabled>
                                        <el-option></el-option>
                                    </el-select>
                                </el-col>
                            </el-row>
                        </el-form-item>

                        <el-form-item label="条款豁免产品：" v-if="basicForm.sourceType_ == '1'">
                            <el-select v-model="basicForm.suitableExemptFund_" placeholder="请选择" size="mini" disabled>
                                <el-option></el-option>
                            </el-select>
                        </el-form-item>
                    </div>

                    <div class="box2">
                        <el-form-item label="来源编号：">
                            <el-input v-model="basicForm.sourceCode_" size="mini" disabled></el-input>
                        </el-form-item>
                        <el-form-item label="来源名称：">
                            <el-input v-model="basicForm.sourceName_" size="mini" disabled></el-input>
                        </el-form-item>
                        <el-form-item label="来源版本号：">
                            <el-input v-model="basicForm.sourceVisible_" size="mini" disabled></el-input>
                        </el-form-item>
                        <el-form-item label="来源状态：">
                            <el-radio-group v-model="basicForm.sourceStatus_" disabled>
                                <el-radio v-for="(value, key) in Dict.IsOpen" :label="key" :key="key">{{ value }}</el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </div>
                    <div :class="{ box4: basicForm.sourceType_ != '3', box1: basicForm.sourceType_ == '3' }">
                        <el-form-item label="来源适用产品：">
                            <el-select
                                v-model="basicForm.sourceSuitableFund_"
                                placeholder="请选择"
                                size="mini"
                                disabled
                                v-if="basicForm.sourceType_ == '3'"
                            >
                                <el-option></el-option>
                            </el-select>
                            <el-row v-else>
                                <el-col :span="8">
                                    <el-checkbox v-model="basicForm.publicMoneySource_" disabled>公募</el-checkbox>
                                    <span>产品类型</span>
                                    <el-select v-model="basicForm.fundTypePublicSource_" placeholder="请选择" size="mini" disabled> </el-select>
                                </el-col>
                                <el-col :span="8">
                                    <el-checkbox v-model="basicForm.simuSource_" disabled>私募</el-checkbox>
                                    <span>产品类型</span>
                                    <el-select v-model="basicForm.fundTypeSimuSource_" placeholder="请选择" size="mini" disabled> </el-select>
                                </el-col>
                                <el-col :span="8">
                                    <el-checkbox v-model="basicForm.zhuanhuSource_" disabled>专户</el-checkbox>
                                    <span>产品类型</span>
                                    <el-select v-model="basicForm.fundTypeZhuanhuSource_" placeholder="请选择" size="mini" disabled> </el-select>
                                </el-col>
                            </el-row>
                        </el-form-item>
                    </div>
                </div>
            </div>
            <div class="o32-entry">
                <h3>O32条目信息</h3>
                <div class="form-box">
                    <div class="box1">
                        <el-form-item label="O32条目编号：" label-width="160px">
                            <el-input v-model="basicForm.O32EntryCode_" size="mini" :disabled="disabled"></el-input>
                        </el-form-item>
                        <el-form-item label="O32风险说明：" label-width="160px">
                            <el-input v-model="basicForm.O32EntryName_" size="mini" :disabled="disabled"></el-input>
                        </el-form-item>
                        <el-form-item label="O32条目状态：">
                            <el-radio-group v-model="basicForm.O32EntryStatus_" disabled>
                                <el-radio v-for="(value, key) in Dict.IsOpen" :label="key" :key="key">{{ value }}</el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </div>

                    <div class="box3">
                        <el-form-item label="O32条目生效日期：" label-width="160px">
                            <el-date-picker v-model="basicForm.O32EntryEffecDate_" type="date" placeholder="选择日期" size="mini" disabled>
                            </el-date-picker>
                        </el-form-item>
                        <el-form-item label="O32条目失效日期：" label-width="160px">
                            <el-date-picker v-model="basicForm.O32EntryLoseEffecDate_" type="date" placeholder="选择日期" size="mini" disabled>
                            </el-date-picker>
                        </el-form-item>
                    </div>
                </div>
            </div>
            <div class="yh-entry">
                <h3>YH条目信息</h3>
                <div class="form-box">
                    <div class="box1">
                        <el-form-item label="YH条目编号：" label-width="160px">
                            <el-input v-model="basicForm.YhEntryCode_" size="mini" :disabled="disabled"></el-input>
                        </el-form-item>
                        <el-form-item label="YH风险说明：" label-width="160px">
                            <el-input v-model="basicForm.YhEntryName_" size="mini" :disabled="disabled"></el-input>
                        </el-form-item>
                        <el-form-item label="YH条目状态：">
                            <el-radio-group v-model="basicForm.YhEntryStatus_" disabled>
                                <el-radio v-for="(value, key) in Dict.IsOpen" :label="key" :key="key">{{ value }}</el-radio>
                            </el-radio-group>
                        </el-form-item>
                    </div>
                    <div class="box3">
                        <el-form-item label="YH条目生效日期：" label-width="160px">
                            <el-date-picker v-model="basicForm.YhEntryEffecDate_" type="date" placeholder="选择日期" size="mini" disabled>
                            </el-date-picker>
                        </el-form-item>
                        <el-form-item label="YH条目失效日期：" label-width="160px">
                            <el-date-picker v-model="basicForm.YhEntryLoseEffecDate_" type="date" placeholder="选择日期" size="mini" disabled>
                            </el-date-picker>
                        </el-form-item>
                    </div>
                </div>
            </div>
            <div class="box5">
                <el-form-item label="合规卡备注：" label-width="160px">
                    <el-input v-model="basicForm.cardRemark_" size="mini" :disabled="disabled"></el-input>
                    <!-- 合规卡备注的是不还要调用下待办处置的接口TODO -->
                </el-form-item>
                <el-form-item label="合规卡状态：">
                    <el-radio-group v-model="basicForm.cardStatus_" disabled>
                        <el-radio v-for="(value, key) in Dict.cardStatusPojo" :label="key" :key="key">{{ value }}</el-radio>
                    </el-radio-group>
                </el-form-item>
            </div>
        </el-form>
    </div>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import { cardSearchDTO } from '../../vo';
import Dict from '../../dict/index';
@Component({ name: 'CardInfo', components: {} })
export default class CardInfo extends Vue {
    Dict = new Dict();

    basicForm: cardSearchDTO = {
        cardCode_: '',
        termCode_: '',
        termId_: '',
        termName_: '',
        suitableFund_: '',
        suitableExemptFund_: '',
        sourceCode_: '',
        sourceName_: '',
        sourceVisible_: '',
        sourceSuitableFund_: '',
        sourceType_: '1',
        sourceStatus_: '1',
        O32EntryCode_: '',
        O32EntryName_: '',
        O32EntryStatus_: '',
        O32EntryEffecDate_: '',
        O32EntryLoseEffecDate_: '',
        YhEntryCode_: '',
        YhEntryName_: '',
        YhEntryStatus_: '',
        YhEntryType_: '',
        YhEntryEffecDate_: '',
        YhEntryLoseEffecDate_: '',
        cardRemark_: '',
        cardStatus_: '',
        creator_: '',
        creatDate_: '',
        modifier_: '',
        moduifyDate_: '',

        publicMoneyTerm_: true,
        fundTypePublicTerm_: '',
        simuTerm_: true,
        fundTypeSimuTerm_: '',
        zhuanhuTerm_: true,
        fundTypeZhuanhuTerm_: '',
        publicMoneySource_: true,
        fundTypePublicSource_: '',
        simuSource_: true,
        fundTypeSimuSource_: '',
        zhuanhuSource_: true,
        fundTypeZhuanhuSource_: '',
    };

    get disabled() {
        return this.basicForm['operationType'] == 'look';
    }
    mounted() {
        this.basicForm = JSON.parse(JSON.stringify(this.$attrs.info));
        console.log(this.basicForm, this.Dict.cardStatusPojo, 'basicForm');
    }
}
</script>
<style lang="scss" scoped>
h3 {
    width: 100px;
    height: 30px;
    position: relative;
    top: 18px;
    left: 8px;
    text-align: center;
    background: #fff;
}
.form-box {
    border: 1px dashed #575757;
    padding-right: 5px;
    .box1 {
        display: grid;
        grid-template-columns: 1fr 2fr 1fr;
    }
    .box2 {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }
    .box3 {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }
    .box4 {
        display: grid;
        grid-template-columns: 3fr 1fr;
        .el-row {
            // display: flex;
            .el-col-8 {
                min-width: 220px;
                padding-right: 10px;
                span {
                    margin: 0 10px;
                }
                /deep/ .el-select {
                    width: calc(100% - 120px);
                }
            }
        }
    }
}

.box5 {
    display: grid;
    grid-template-columns: 3fr 1fr;
}
/deep/ .el-input {
    width: 100%;
}
/deep/ .el-select {
    width: 100%;
}
</style>
